package Helper;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Locale;

public class Helper_OutletReservation implements Serializable {

    //****************************************************************************************
    //Datafields
    //****************************************************************************************
    private Long id;
    private String customerName;
    private String outletName;
    private Calendar timeslot;
    private String areaName;
    private boolean confirmStatus;
    private boolean customerShowUp;
    private String comments;

    //****************************************************************************************
    //Get and set methods
    //****************************************************************************************
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getOutletName() {
        return outletName;
    }

    public void setOutletName(String outletName) {
        this.outletName = outletName;
    }

    public Calendar getTimeslot() {
        return timeslot;
    }

    public void setTimeslot(Calendar timeslot) {
        this.timeslot = timeslot;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public boolean isConfirmStatus() {
        return confirmStatus;
    }

    public void setConfirmStatus(boolean confirmStatus) {
        this.confirmStatus = confirmStatus;
    }

    public boolean isCustomerShowUp() {
        return customerShowUp;
    }

    public void setCustomerShowUp(boolean customerShowUp) {
        this.customerShowUp = customerShowUp;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getDateStr() {
        String[] months = new String[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
        String[] weekDays = new String[]{"Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"};
        Calendar t = (Calendar) timeslot.clone();
        String s = t.get(Calendar.DATE) + " " + months[t.get(Calendar.MONTH)] + ", "
                + t.get(Calendar.YEAR) + " (" + weekDays[t.get(Calendar.DAY_OF_WEEK)-1] + ")";
        return s;
    }

    public String getTimeStr() {
        Calendar t = (Calendar) timeslot.clone();
        String hour = String.valueOf(t.get(Calendar.HOUR_OF_DAY));
        String minute = String.valueOf(t.get(Calendar.MINUTE));
        if (minute.length() == 1) {
            minute = "0" + minute;
        }
        String s = hour + ":" + minute;
        return s;
    }
}
